package com.sensePlusVR.widget.refresh;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;

import com.sensePlusVR.main.R;

public class LoadMoreFooterView extends TextView implements SwipeTrigger, SwipeLoadMoreTrigger{

	 public LoadMoreFooterView(Context context) {
	        super(context);
	    }

	    public LoadMoreFooterView(Context context, AttributeSet attrs) {
	        super(context, attrs);
	    }

	    @Override
	    public void onLoadMore() {
	    	setTextColor(getResources().getColor(R.color.app_text_color_gray1));
	    	//setTextSize(getResources().getDimension(R.dimen.text_font_size_large2));
	        setText(R.string.loading_more);
	    }

	    @Override
	    public void onPrepare() {
	        setText("");
	    }

	    @Override
	    public void onMove(int yScrolled, boolean isComplete, boolean automatic) {
	    	setTextColor(getResources().getColor(R.color.app_text_color_gray1));
	    	//setTextSize(getResources().getDimension(R.dimen.text_font_size_large2));
	        if (!isComplete) {
	            if (yScrolled <= -getHeight()) {
	                setText(R.string.release_to_load_more);
	            } else {
	                setText(R.string.swipe_to_load_more);
	            }
	        } else {
	            setText(R.string.load_more_returning);
	        }
	    }

	    @Override
	    public void onRelease() {
	    	setTextColor(getResources().getColor(R.color.app_text_color_gray1));
	    	//setTextSize(getResources().getDimension(R.dimen.text_font_size_large2));
	        setText(R.string.loading_more);
	    }

	    @Override
	    public void onComplete() {
	    	setTextColor(getResources().getColor(R.color.app_text_color_gray1));
	    	//setTextSize(getResources().getDimension(R.dimen.text_font_size_large2));
	        setText(R.string.complete);
	    }

	    @Override
	    public void onReset() {
	        setText("");
	    }
	    
}
